﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using monadsphere.js;
using monadsphere.dom;
using monadsphere.dom.html2;

/// <summary>
/// This unit contains Google Maps API wrapping classes.
/// 
/// For details, see http://code.google.com/apis/maps/documentation/
/// </summary>
/// 
namespace monadsphere {

    public partial class google {

        public class maps: JSVar {

            protected static maps instance = new maps();

            protected maps() {
                name = "google.maps";
            }

            public static void Unload() {
                instance.callProcedure("Unload");
            }

            public static JSBoolean BrowserIsCompatible() {
                return instance.callFunction<JSBoolean>("BrowserIsCompatible");
            }

            public class Size: JSVar {

                public Size(JSVar src)
                    : base(src) {
                }

                public Size(JSNumber width, JSNumber height)
                    : base(callConstructor("google.maps.Size", width, height)) {
                }

                public JSNumber width {
                    get {
                        return getProperty<JSNumber>("width");
                    }
                    set {
                        setProperty("width", value);
                    }
                }

                public JSNumber height {
                    get {
                        return getProperty<JSNumber>("height");
                    }
                    set {
                        setProperty("height", value);
                    }
                }
            }

            public class MapOptions: JSVar {
                public MapOptions(JSVar src)
                    : base(src) {
                }

                public Size size {
                    get {
                        return getProperty<Size>("size");
                    }
                    set {
                        setProperty("size", value);
                    }
                }
            }

            public class LatLng: JSVar {
                public LatLng(JSVar src)
                    : base(src) {
                }

                public LatLng(JSNumber lat, JSNumber lng)
                    : base(callConstructor("google.maps.LatLng", lat, lng)) {
                }

                public LatLng(JSNumber lat, JSNumber lng, JSBoolean unbounded)
                    : base(callConstructor("google.maps.LatLng", lat, lng, unbounded)) {
                }

                public JSNumber lat() {
                    return callFunction<JSNumber>("lat");
                }

                public JSNumber lng() {
                    return callFunction<JSNumber>("lng");
                }
            }

            public class LatLngBounds: JSVar {
                public LatLngBounds(JSVar src)
                    : base(src) {
                }

                public LatLngBounds()
                    : base(callConstructor("google.maps.LatLngBounds")) {
                }

                public LatLngBounds(LatLng sw)
                    : base(callConstructor("google.maps.LatLngBounds", sw)) {
                }

                public LatLngBounds(LatLng sw, LatLng ne)
                    : base(callConstructor("google.maps.LatLngBounds", sw, ne)) {
                }

                public LatLng getSouthWest() {
                    return callFunction<LatLng>("getSouthWest");
                }

                public LatLng getNorthEast() {
                    return callFunction<LatLng>("getNorthEast");
                }
            }

            public class Overlay: JSVar {
                public Overlay(JSVar src)
                    : base(src) {
                }

                public JSNumber getZIndex(JSNumber latitude) {
                    return callFunction<JSNumber>("getZIndex", latitude);
                }
            }

            public class Marker: Overlay {

                public Marker(JSVar src)
                    : base(src) {
                }

                public Marker(LatLng latlng)
                    : base(callConstructor("google.maps.Marker", latlng)) {
                }
            }

            public class EventListener: JSVar {
                public EventListener(JSVar src)
                    : base(src) {
                }
            }

            public class Event: JSVar {

                protected static Event instance = new Event();

                protected Event() {
                    name = "google.maps.Event";
                }

                public static EventListener addListener(JSVar source, JSString evt, JSFunction handler) {
                    return instance.callFunction<EventListener>("addListener", source, evt, handler);
                }

                public static EventListener addDomListener(Node source, JSString evt, JSFunction handler) {
                    return instance.callFunction<EventListener>("addDomListener", source, evt, handler);
                }

                public static void removeListener(EventListener handle) {
                    instance.callProcedure("removeListener", handle);
                }

                public static void clearListeners(JSObject source, JSString evt) {
                    instance.callProcedure("clearListeners", source, evt);
                }

                public static void clearListeners(Node source, JSString evt) {
                    instance.callProcedure("clearListeners", source, evt);
                }

                public static void clearInstanceListeners(JSObject source) {
                    instance.callProcedure("clearInstanceListeners", source);
                }

                public static void clearInstanceListeners(Node source) {
                    instance.callProcedure("clearInstanceListeners", source);
                }

                public static void clearNode(Node source) {
                    instance.callProcedure("clearNode", source);
                }

                public static void trigger(JSObject source, JSString evt, params object[] args) {
                    instance.callProcedure("trigger", source, evt, args);
                }

                public static EventListener bind(JSObject source, JSString evt, JSObject obj, JSFunction method) {
                    return instance.callFunction<EventListener>("bind", source, evt, obj, method);
                }

                public static EventListener bindDom(Node source, JSString evt, JSObject obj, JSFunction method) {
                    return instance.callFunction<EventListener>("bindDom", source, evt, obj, method);
                }
            }

            public class MapUIOptions: JSVar {

                public MapUIOptions(JSVar src)
                    : base(src) {
                }

                public MapUIOptions(Size opt_size)
                    : base(callConstructor("google.maps.MapUIOptions", opt_size)) {
                }

                public Maptypes maptypes {
                    get {
                        return getProperty<Maptypes>("maptypes");
                    }
                }

                public Zoom zoom {
                    get {
                        return getProperty<Zoom>("zoom");
                    }
                }

                public JSBoolean keyboard {
                    set {
                        setProperty("keyboard", value);
                    }
                }

                public class Maptypes: JSVar {
                    public Maptypes(JSVar src)
                        : base(src) {
                    }

                    public JSBoolean normal {
                        set {
                            setProperty("normal", value);
                        }
                    }

                    public JSBoolean satellite {
                        set {
                            setProperty("satellite", value);
                        }
                    }

                    public JSBoolean hybrid {
                        set {
                            setProperty("hybrid", value);
                        }
                    }

                    public JSBoolean physical {
                        set {
                            setProperty("physical", value);
                        }
                    }
                }

                public class Zoom: JSVar {
                    public Zoom(JSVar src)
                        : base(src) {
                    }

                    public JSBoolean scrollwheel {
                        set {
                            setProperty("scrollwheel", value);
                        }
                    }

                    public JSBoolean doubleclick {
                        set {
                            setProperty("doubleclick ", value);
                        }
                    }
                }

                public class controls: JSVar {
                    public controls(JSVar src)
                        : base(src) {
                    }

                    public JSBoolean largemapcontrol3d {
                        set {
                            setProperty("largemapcontrol3d", value);
                        }
                    }

                    public JSBoolean smallzoomcontrol3d {
                        set {
                            setProperty("smallzoomcontrol3d", value);
                        }
                    }

                    public JSBoolean maptypecontrol {
                        set {
                            setProperty("maptypecontrol", value);
                        }
                    }

                    public JSBoolean menumaptypecontrol {
                        set {
                            setProperty("menumaptypecontrol", value);
                        }
                    }

                    public JSBoolean scalecontrol {
                        set {
                            setProperty("scalecontrol ", value);
                        }
                    }
                }
            }

            public class ControlAnchor: JSVar {

                protected static ControlAnchor instance = new ControlAnchor();
                protected ControlAnchor() {
                    name = "window";
                }

                public ControlAnchor G_ANCHOR_TOP_RIGHT {
                    get {
                        return getProperty<ControlAnchor>("G_ANCHOR_TOP_RIGHT");
                    }
                }

                public ControlAnchor G_ANCHOR_TOP_LEFT {
                    get {
                        return getProperty<ControlAnchor>("G_ANCHOR_TOP_LEFT");
                    }
                }

                public ControlAnchor G_ANCHOR_BOTTOM_RIGHT {
                    get {
                        return getProperty<ControlAnchor>("G_ANCHOR_BOTTOM_RIGHT");
                    }
                }

                public ControlAnchor G_ANCHOR_BOTTOM_LEFT {
                    get {
                        return getProperty<ControlAnchor>("G_ANCHOR_BOTTOM_LEFT");
                    }
                }
            }

            public class ControlPosition: JSVar {

                public ControlPosition(JSVar src)
                    : base(src) {
                }

                public ControlPosition(ControlAnchor anchor, Size offset)
                    : base(callConstructor("google.maps.ControlPosition", anchor, offset)) {
                }
            }

            public class Control: JSVar {
                public Control(JSVar src)
                    : base(src) {
                }

                public Control()
                    : base(callConstructor("google.maps.Control")) {
                }

                public Control(JSBoolean printable)
                    : base(callConstructor("google.maps.Control", printable)) {
                }

                public Control(JSBoolean printable, JSBoolean selectable)
                    : base(callConstructor("google.maps.Control", printable, selectable)) {
                }

                public JSBoolean printable() {
                    return callFunction<JSBoolean>("printable");
                }

                public JSBoolean selectable() {
                    return callFunction<JSBoolean>("selectable");
                }

                public Node initialize(Map2 map) {
                    return callFunction<Node>("initialize", map);
                }

                public ControlPosition getDefaultPosition() {
                    return getProperty<ControlPosition>("getDefaultPosition");
                }
            }

            public class Copyright: JSVar {
                public Copyright(JSVar src): base(src) {
                }

                public Copyright(JSNumber id, LatLngBounds bounds, JSNumber minZoom, JSString text): base(callConstructor("google.maps.Copyright", id, bounds, minZoom, text)) {
                }

                public JSNumber id {
                    get {
                        return getProperty<JSNumber>("id");
                    }
                }

                public JSNumber minZoom {
                    get {
                        return getProperty<JSNumber>("minZoom");
                    }
                }

                public LatLngBounds bounds {
                    get {
                        return getProperty<LatLngBounds>("bounds");
                    }
                }

                public JSNumber text {
                    get {
                        return getProperty<JSNumber>("text");
                    }
                }
            }

            public class CopyrightCollection: JSVar {
            
                public CopyrightCollection(JSVar src): base(src) {
                }

                public CopyrightCollection(JSString prefix): base(callConstructor("google.maps.CopyrightCollection", prefix)) {
                }

                public void addCopyright(Copyright copyright) {
                    callProcedure("addCopyright", copyright);
                }

                public JSObject getCopyrights(LatLngBounds bounds, JSNumber zoom) {
                    return callFunction<JSObject>("getCopyrights", bounds, zoom);
                }

                public JSString getCopyrightNotice(LatLngBounds bounds, JSNumber zoom) {
                    return callFunction<JSString>("getCopyrightNotice", bounds, zoom);
                }
            }
            public class MapType: JSVar {
                public MapType(JSVar src)
                    : base(src) {
                }

                public MapType() {
                }
            }

            public class Map2: JSVar {

                
                public Map2(JSVar src)
                    : base(src) {
                }

                public Map2(HTMLDivElement container, MapOptions opt)
                    : base(callConstructor("google.maps.Map2", container, opt)) {
                }

                public void enableDragging() {
                    callProcedure("enableDragging");
                }

                public void disableDragging() {
                    callProcedure("disableDragging");
                }

                public JSBoolean draggingEnabled() {
                    return callFunction<JSBoolean>("draggingEnabled");
                }

                public void enableInfoWindow() {
                    callProcedure("enableInfoWindow");
                }

                public void disableInfoWindow() {
                    callProcedure("disableInfoWindow");
                }

                public JSBoolean infoWindowEnabled() {
                    return callFunction<JSBoolean>("infoWindowEnabled");
                }

                public void enableDoubleClickZoom() {
                    callProcedure("enableDoubleClickZoom");
                }

                public void disableDoubleClickZoom() {
                    callProcedure("disableDoubleClickZoom");
                }

                public JSBoolean doubleClickZoomEnabled() {
                    return callFunction<JSBoolean>("doubleClickZoomEnabled");
                }

                public void enableContinuousZoom() {
                    callProcedure("enableContinuousZoom");
                }

                public void disableContinuousZoom() {
                    callProcedure("disableContinuousZoom");
                }

                public JSBoolean continuousZoomEnabled() {
                    return callFunction<JSBoolean>("continuousZoomEnabled");
                }

                public void enableGoogleBar() {
                    callProcedure("enableGoogleBar");
                }

                public void disableGoogleBar() {
                    callProcedure("disableGoogleBar");
                }

                public void enableScrollWheelZoom() {
                    callProcedure("enableScrollWheelZoom");
                }

                public void disableScrollWheelZoom() {
                    callProcedure("disableScrollWheelZoom");
                }

                public JSBoolean scrollWheelZoomEnabled() {
                    return callFunction<JSBoolean>("scrollWheelZoomEnabled");
                }

                public void enablePinchToZoom() {
                    callProcedure("enablePinchToZoom");
                }

                public void disablePinchToZoom() {
                    callProcedure("disablePinchToZoom");
                }

                public JSBoolean pinchToZoomEnabled() {
                    return callFunction<JSBoolean>("pinchToZoomEnabled");
                }

                public MapUIOptions getDefaultUI() {
                    return callFunction<MapUIOptions>("getDefaultUI");
                }

                public void setUIToDefault() {
                    callProcedure("setUIToDefault");
                }

                public void setUI(MapUIOptions ui) {
                    callProcedure("setUI", ui);
                }

                public void addControl(Control control) {
                    callProcedure("addControl", control);
                }

                public void addControl(Control control, ControlPosition position) {
                    callProcedure("addControl", control, position);
                }

                public void removeControl(Control control) {
                    callProcedure("removeControl", control);
                }

                public Node getContainer() {
                    return callFunction<Node>("getContainer");
                }

                public JSArray<MapType> getMapTypes() {
                    return callFunction<JSArray<MapType>>("getMapTypes");
                }

                public void setCenter(LatLng center, JSNumber zoom) {
                    callProcedure("setCenter", center, zoom);
                }

                public LatLngBounds getBounds() {
                    return callFunction<LatLngBounds>("getBounds");
                }

                public LatLng getCenter() {
                    return callFunction<LatLng>("getCenter");
                }

                public void openInfoWindow(LatLng latlng, Node node) {
                    callProcedure("openInfoWindow", latlng, node);
                }

                public void addOverlay(Overlay overlay) {
                    callProcedure("addOverlay", overlay);
                }

                public void removeOverlay(Overlay overlay) {
                    callProcedure("removeOverlay", overlay);
                }

                public void clearOverlays() {
                    callProcedure("clearOverlays");
                }

                public delegate void addmaptypefunc(MapType type);
            }
        }
    }
}
